package com.alon.spring01.service.impl;

import com.alibaba.fastjson.JSON;
import com.alon.spring01.common.config.pool.InsuranceTask;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.Date;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;
import com.alon.spring01.model.InsuranceBaseInfo;
import com.alon.spring01.mapper.InsuranceBaseInfoMapper;
import com.alon.spring01.service.InsuranceBaseInfoService;
import org.springframework.transaction.annotation.Transactional;

@Service
@Slf4j
public class InsuranceBaseInfoServiceImpl implements InsuranceBaseInfoService{



    @Resource
    private InsuranceBaseInfoMapper insuranceBaseInfoMapper;

    @Override
    public int insert(InsuranceBaseInfo insuranceBaseInfo){
        return insuranceBaseInfoMapper.insert(insuranceBaseInfo);
    }

    @Override
    public int insertSelective(InsuranceBaseInfo insuranceBaseInfo){
        return insuranceBaseInfoMapper.insertSelective(insuranceBaseInfo);
    }

    @Override
    @Async("taskExecutor")

    public void insertList(){


    }

    @Override
    public int updateByPrimaryKeySelective(InsuranceBaseInfo insuranceBaseInfo){
        return insuranceBaseInfoMapper.updateByPrimaryKeySelective(insuranceBaseInfo);
    }

    public PageInfo<InsuranceBaseInfo> findwithPage(int page, int pageSize) {
        PageHelper.startPage(page, pageSize);
        return new PageInfo<>(insuranceBaseInfoMapper.find());
    }
}
